package com.zoke.loveway.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.zoke.loveway.R;
import com.zoke.loveway.ui.LoginAndRegest;
import com.zoke.support.utils.ViewHolder;

public class WelcomeAdapter extends BasePagerAdapter {

	public WelcomeAdapter(Context context, List<? extends Object> datas) {
		super(context, datas);
	}

	@Override
	public View getItemView(ViewGroup container, int position) {
		View convertView = mInflater.inflate(R.layout.viewpager_item_welcome,
				null);
		ImageView mIv = ViewHolder.get(convertView, R.id.welcomeIv);
		TextView mStartTv = ViewHolder.get(convertView, R.id.startBtn);
		int resId = (Integer) mDatas.get(position);
		mIv.setImageResource(resId);
		mStartTv.setVisibility(position == 3 ? View.VISIBLE : View.GONE);
		mStartTv.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				LoginAndRegest.open();
			}
		});
		return convertView;
	}

}
